<?php

namespace App\Http\Controllers\Api\O1;

use Biz\Constants\Site\SiteMenuConstants;
use Biz\Services\Site\SitePromoService;
use Biz\Transformers\Site\PromoTransformerCollection;
use Illuminate\Http\Request;
use Biz\Services\Site\SiteMenuService;
use Biz\Services\Site\SiteMenuModuleService;
use Biz\Transformers\Site\MenuTransformerCollection;
use Laravel\Lumen\Routing\Controller as BaseController;
use Lumen\Core\Exceptions\BusinessException;

/**
 * PromoController.
 *
 * @license [http://www.85do.com] [杭州永奥网络科技有限公司]
 * @copyright Copyright (c) 2018-2026 Hangzhou Yongao Technology Co., Ltd. All rights reserved.
 */
class PromoController extends BaseController
{
    /**
     * @var mixed
     */
    protected $service;

    /**
     * MenuController constructor.
     *
     * @param SitePromoService $service
     */
    public function __construct(SitePromoService $service)
    {
        $this->service           = $service;
    }

    /**
     * 获取所有菜单节点
     *
     * @return \Illuminate\Http\Response
     */
    public function index(Request $request)
    {
        $results = $this->service->getAll($request);

        return new PromoTransformerCollection($results);
    }
}
